#ifndef _SERIAL_UART_H_
#define _SERIAL_UART_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <pthread.h>

#define DEVICE "/dev/ttyAMA1"
#define BAUDRATE B115200

typedef enum INFRARED_MACHINE_CORE_COLOR_TYPE_E{
    WHITE_HOT = 0,
    BLACK_HOT,
    IRON_RED_PSEUDO_COLOR,
    RAINBOW_PSEUDO_COLOR = 8
}INFRARED_MACHINE_CORE_COLOR_TYPE_E;

typedef enum ChipCtrlType_E{
    CHIP_CRTL_PSEUDO_COLOR = 100,         //伪彩
    CHIP_CRTL_ELECTRONIC_ZOOM,         //电子变倍
    CHIP_CRTL_SHUTTER_CALIBRATION,     //快门校正开关
    CHIP_CRTL_MANUAL_SHUTTER_CALIBRATION,    //手动快门校正
    CHIP_CRTL_HORIZONTAL_IMAGE_FLIP,
    CHIP_CRTL_VERTICAL_IMAGE_FLIP,
    CHIP_CRTL_ANALOG_VIDEO_SWITCH,
    CHIP_CRTL_OUTPUT_VIDEO_FORMAT,
    CHIP_CRTL_SAVE_USER_CONFIG,
    CHIP_CRTL_GET_USER_CONFIG,
    TEST_UPGRADE

}ChipCtrlType_E;

int serial_init(const char *device);
int serial_write(int fd, char *buf, size_t count) ;
int serial_read(int fd, char *buf, size_t count);

#endif